home *** CD-ROM | disk | FTP | other *** search
/ Aminet 31 / Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso / Aminet / util / libs / regex.lha / regex / STORMCinclude / libraries / regex.h
Encoding:
C/C++ Source or Header  |  1999-04-23  |  1.6 KB  |  71 lines

  1.  
  2. #ifndef LIBRARIES_REGEX_H
  3. #define LIBRARIES_REGEX_H
  4.  
  5. #ifndef EXEC_TYPES_H
  6. #include <exec/types.h>
  7. #endif
  8.  
  9. #ifndef _INCLUDE_STDDEF_H
  10. #include <stddef.h>
  11. #endif
  12.  
  13. typedef long regoff_t;
  14.  
  15. typedef struct
  16. {
  17.     int re_magic;
  18.     size_t re_nsub;         /* number of parenthesized subexpressions */
  19.     const char *re_endp;    /* end pointer for REG_PEND */
  20.     struct re_guts *re_g;   /* none of your business :-) */
  21. } regex_t;
  22.  
  23. typedef struct
  24. {
  25.     regoff_t rm_so;     /* start of match */
  26.     regoff_t rm_eo;     /* end of match */
  27. } regmatch_t;
  28.  
  29.  
  30. /* === regcomp flags === */
  31. #define REG_BASIC       0000
  32. #define REG_EXTENDED    0001
  33. #define REG_ICASE       0002
  34. #define REG_NOSUB       0004
  35. #define REG_NEWLINE     0010
  36. #define REG_NOSPEC      0020
  37. #define REG_PEND        0040
  38. #define REG_DUMP        0200
  39.  
  40.  
  41. /* === regerror code === */
  42. #define REG_NOMATCH  1
  43. #define REG_BADPAT   2
  44. #define REG_ECOLLATE 3
  45. #define REG_ECTYPE   4
  46. #define REG_EESCAPE  5
  47. #define REG_ESUBREG  6
  48. #define REG_EBRACK   7
  49. #define REG_EPAREN   8
  50. #define REG_EBRACE   9
  51. #define REG_BADBR   10
  52. #define REG_ERANGE  11
  53. #define REG_ESPACE  12
  54. #define REG_BADRPT  13
  55. #define REG_EMPTY   14
  56. #define REG_ASSERT  15
  57. #define REG_INVARG  16
  58. #define REG_ATOI    255     /* convert name to number (!) */
  59. #define REG_ITOA    0400    /* convert number to name (!) */
  60.  
  61.  
  62. /* === regexec code === */
  63. #define REG_NOTBOL      00001
  64. #define REG_NOTEOL      00002
  65. #define REG_STARTEND    00004
  66. #define REG_TRACE       00400   /* tracing of execution */
  67. #define REG_LARGE       01000   /* force large representation */
  68. #define REG_BACKR       02000   /* force use of backref code */
  69.  
  70. #endif /* LIBRARIES_REGEX_H */
  71.